package net.borlis.processor.impl.object;

import net.borlis.processor.api.object.AccountObject;
import net.borlis.processor.api.object.UserObject;
import net.borlis.processor.dao.entity.AccountEntity;

import java.io.Serializable;
import java.math.BigInteger;

/**
 * Created by borlis on 24.12.2014.
 */
public class AccountObjectImpl implements AccountObject, Serializable {

    private static final long serialVersionUID = -7788619177798333712L;

    private BigInteger id;
    private UserObject userObject;
    private String name;
    private String login;

    public AccountObjectImpl(AccountEntity accountEntity) {
        this.userObject = new UserObjectImpl(accountEntity.getUser());
        this.id = accountEntity.getId();
        this.login = accountEntity.getLogin();
        this.name = accountEntity.getName() + " " + accountEntity.getSurname();
    }

    public BigInteger getId() {
        return id;
    }

    public UserObject getUserObject() {
        return userObject;
    }

    public String getName() {
        return name;
    }

    public String getLogin() {
        return login;
    }
}
